package com.rou.im.framework.core.context;

import com.rou.im.framework.core.Request;
import com.rou.im.framework.core.RequestVO;
import com.rou.im.framework.core.Response;
import com.rou.im.framework.core.exception.CommonRuntimeException;
import com.rou.im.framework.core.processorstack.TargetAction;

/**
 * <p></p>
 *
 * @author GaoShuangWen
 * @since 2020-04-17 23:42
 */
public class RequestContextImpl implements RequestContext {

    private Request request;

    private Response response;

    private CommonRuntimeException exception;

    private TargetAction action;

    private RequestVO requestVO;

    @Override
    public Request getRequest() {

        return this.request;
    }

    @Override
    public Response getResponse() {
        return this.response;
    }
    @Override
    public Integer getCmdId() {
        return this.request.getRequestHeaders().getCmdId();
    }
    @Override
    public void setResponse(Response response) {
        this.response = response;
    }

    @Override
    public void setRequest(Request request) {
        this.request = request;
    }

    @Override
    public CommonRuntimeException getException() {
        return exception;
    }

    @Override
    public void setException(CommonRuntimeException exception) {
        this.exception = exception;
    }

    @Override
    public RequestVO getRequestVO() {
        return requestVO;
    }
    @Override
    public void setRequestVO(RequestVO requestVO) {
        this.requestVO = requestVO;
    }
    @Override
    public TargetAction getAction() {
        return action;
    }
    @Override
    public void setAction(TargetAction action) {
        this.action = action;
    }
}
